package com.jiang.daily.Q3000;

/**
 * @author Jiang
 * @version 1.0
 * @date 2025/08/26 9:31
 */
class Solution {
    public int areaOfMaxDiagonal(int[][] dimensions) {
        int diagonal = 0;
        int area = 0;
        for (int i = 0; i < dimensions.length; i++) {
            int t1 = dimensions[i][0] * dimensions[i][0] + dimensions[i][1] * dimensions[i][1];
            int t2 = dimensions[i][0] * dimensions[i][1];

            if (t1 > diagonal) {
                diagonal = t1;
                area = t2;
            } else if (t1 == diagonal) {
                area = Math.max(area, t2);
            }
        }
        return area;
    }
}
